forked from openstack/oslo.vmware
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zeep #4
Draft
joker-at-work
wants to merge
9
commits into
stable/queens-m3
Choose a base branch
from
zeep
base: stable/queens-m3
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Zeep #4
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zeep doesn't log the full request in anything other than DEBUG logging. Change-Id: I32b55bb3f68d6668dd92906742b0427d2838a5c6
We need to update `get_moref()` to support the way `zeep` is creating and passing a ManagedObjectReference to the vCenter. Since the attribute access changed from suds to zeep (before: .value and ._type; after: ._value_1 and .type), we introduce two helper functions to be used everywhere a moref value/type needs to be extracted from a ManagedObjectReference object or string. These functions are intended to stop the actual SOAP library implementation to leak out of oslo_vmware and in depending code. Having leaked abstractions in other code make changes harder. In that spirit, we also change all references inside of oslo_vmware to using `get_moref_value()` and `get_moref_type()` instead of directly accessing the attributes. Change-Id: I208460c9293478f261176c25e8f0e2552b1dde69
Change-Id: I91d454df4b4e70063f9dc36bc870a3d35179c86f
This function can be used to check if an object as returned by the API is of a certain type or descends from it. It's necessary to have this function in oslo.vmware, because implementing it in depending projects would leak zeep specificas through the oslo.vmware library abstraction. Change-Id: Ifa0f38ee98cc7f78be0af96c34ad76a2a33ecf89
This function converts a zeep object to a dictionary - an OrderedDict to be precise. Some depending code had this implemented itself, but since it's specific to the SOAP library, we pull it into oslo.vmware so we don't leak specificas of the underlying SOAP library through the oslo.vmware abstraction. Change-Id: I6534e9e7994b110817315192e5ef7343e9b3743e
This is the biggest change in the migration from suds to zeep as it touches the main object containing the SOAP client. We define an interface for accessing the cookiejar, as it showed, that it might be placed on different objects for different SOAP libraries. We can now access it via '.client.cookiejar' on the 'Service' object. The MemoryCache implementation used for suds gets removed, because zeep comes with its own implementation. There are minimal differences in behavior: one cannot set the timeout for a specific key anymore. But as far as I have seen, this wasn't used anyways. There is also no need for RequestsTransport anymore, as zeep uses requests by default. We can also pass the parameters and the additional LocalFileAdapter into the session used by requests as was done before. While I can't say if the vSphere API still has the problems worked around with 'ServiceMessagePlugin', we use two plugins for zeep doing the same thing. For keeping compatibility with code written for suds' 'Client' object, we introduce a 'CompatibilityZeepClient' object. This is a zeep 'Client' extended to contain the cookiejar attributes and a 'factory' attribute, that behaves like the former 'factory' provided by suds. We also overwrite the 'soap_url' in this client's '__init__()', because zeep doesn't give us another way of changing it - it always takes the one from the WSDL binding. Change-Id: Icc781d025ef3987584dbe15dbb68554c22b9a2a1
…ze a hard limit)" Change-Id: I8a88bfc5c95c6e5bbfa34d8c4a15f293160a72e8
…ter" Change-Id: Ib7f5be0a32f5023fb8681af250ffe658476f6859
The AddAnyTypeTypeAttributePlugin needs to keep the type of a removeKey, if it's already set and only default to setting string or int otherwise. Thre reason for this is, that the vSphere API expects the type of the key of the array to be set as the type of the removeKey e.g. a ManagedObjectReference. Change-Id: I7aaf53b69e7f80716d316234213925be985179ce
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.